home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / cli / tom_shel.lzh / TSH_REF.TXT < prev   
Text File  |  1991-08-10  |  26KB  |  688 lines

  1.             TomShell Reference Manual
  2.                  October 4, 1990
  3.                last revised August 10, 1991
  4.                 Tom Clegg
  5.  
  6.  Table of Contents
  7.  -----------------
  8.   0. 0.200! new features
  9.   1. TomShell Commands
  10.     alias        dir        ls        system
  11.     author        echo        mkdir        unalias
  12.     cat        exit        mv        unset
  13.     cd        help        ren        verbatim
  14.     cls        history        rm        word
  15.     condense    input        rmdir
  16.     cp        interact    set
  17.   2. Batch file only commands
  18.     gosub        resume
  19.     goto        return
  20.     if        :label
  21.     ifv
  22.   3. Special variables
  23.     0..99        dcdwatch    keystat        quick
  24.     anygem        f        margin        resolution
  25.     cwd        f1..f20        mem        status
  26.     date        font        nolabel        time
  27.     disk        force        owrite        verbosity
  28.     dcd        key        PATH        volume
  29.     **********  NEW: pause, prompt, shortdir, width  ***********
  30.   4. Special characters
  31.     >    >>    <    $    \    #    ;    !    "
  32.   5. Explanations
  33.       .1 Batch files
  34.     .2 Errorlevels
  35.     .3 Filename completion
  36.     .4 Modes of Operation
  37.     .5 Output devices
  38.     .6 Running Programs
  39.     .7 Variables
  40.    
  41.  =======================================================================
  42.   
  43.  0. 0.200! New features
  44.  ----------------------
  45.   .1    Finally, "ls" does good columns!  The list goes down the first (left)
  46.       column, down the second column, down the third column, and so on.
  47.     This is much better for actually trying to find files.  Maybe
  48.     eventually this will be used in the "help" command as well. :-)
  49.  
  50.   .2    Two new variables have been implemented: pause and prompt.  Check
  51.     out the appropriate sections in the manual (search for "(NEW)").
  52.     I'm especially proud of "prompt".  :-)  Why are there so many
  53.     happy faces here?  :-)
  54.  
  55.   .3    Two more variables have been implemented: shortdir and width.  Again,
  56.     check for function later on.
  57.  
  58.   .4    With all these new variables, the "set" output got far too long to
  59.     be useful (on a 25-line screen, all user variables were scrolled off
  60.     the top by the system variables), so the system variables are hidden
  61.     unless a "set s" command is given.  Much nicer looking.
  62.  
  63.   .5    Small and probably unnoticed feature removed: "alias f" would do
  64.     the "set f" output but preceded by "f=    ".  Rather insignificant,
  65.     but worth fixing anyway.  :-)
  66.   
  67.  1. TomShell Commands
  68.  --------------------
  69.  alias         author        cat           cd            cls           condense
  70.  cp            dir           echo          exit          help          history
  71.  input         interact      ls            mkdir         mv            ren
  72.  rm            rmdir         set           system        unalias       unset
  73.  verbatim      word
  74.  
  75.  alias        assign a complex meaning to a simple word.
  76.  
  77.         alias jim cat d:\stadel\money    # `jim' now means `cat d:\...'
  78.         alias jim            # what is "jim" aliased as?
  79.         alias                # list all aliases
  80.  
  81.  author        display initial message about me and my address.
  82.  
  83.         author
  84.  
  85.  cat        display a [text] file to the current output device.  Can
  86.         be redirected via >whatever
  87.  
  88.         cat file1
  89.         cat file1 file2
  90.  
  91.  cd        change current default (working) directory.  Equivalent to
  92.         "set cwd ..."
  93.  
  94.         cd e:\stadel\
  95.         cd \files\texts
  96.         cd d:\
  97.  
  98.  cls        clear the screen using the VT52 "esc E" command.  Can
  99.         be redirected via >whatever
  100.  
  101.         cls
  102.  
  103.  condense    take the spaces out of a variable's value.
  104.  
  105.         condense blah    # blah="foo bar" => blah="foobar"
  106.  
  107.  cp        copy files.  If there is more than one argument, the last
  108.         one is considered to be the destination directory or file.
  109.  
  110.         cp jimbob.doc joebob.asc      # copy jimbob to joebob
  111.         cp fubar.txt \texts\          # copy fubar.txt to \texts\
  112.         cp fubar1.txt fubar2.txt \texts\
  113.         cp fu*.doc \texts\
  114.         cp fu*.doc              # copy to current dir.
  115.         cp fubar.txt              # copy to current dir.
  116.  
  117.  dir        list files in current or given directory.  A search mask
  118.         or path may be given.  Each file is displayed on a separate
  119.         line, with its size, date, time, and status bits displayed
  120.         in neat columns along with it.  Subdirectories are denoted
  121.         by a trailing "\".
  122.  
  123.         dir            # list all files in cwd
  124.         dir \texts\        # list all files in \texts\
  125.         dir \texts\*.doc
  126.         dir *.txt *.doc g:\*.c
  127.  
  128.  echo        display the arguments to the current output device.
  129.  
  130.         echo blah        # output: blah<cr/lf>
  131.         echo            # output: <cr/lf>
  132.         echo -n blah        # output: blah
  133.         echo this is a test
  134.         echo -n this is a test
  135.         echo -n $disk;echo k    # output: (eg) 763k
  136.  
  137.  exit        exit the current batch file or interactive session.
  138.  
  139.         exit
  140.         exit 44            # sets $status to 44 and, if exiting
  141.                       TomShell completely, returns 44
  142.                       to the calling program.
  143.         (see also "system")
  144.         
  145.  
  146.  help        display a list of available commands and reserved variables.
  147.  
  148.         help
  149.  
  150.  history    display the last twenty commands entered, with line numbers.
  151.         These entries can be accessed with !# or !string (!# refers
  152.         to the line with the given number attached to it, !string
  153.         to the most recent command starting with "string").
  154.  
  155.         history
  156.  
  157.  input        take one line of text input from the current input device
  158.         and place the received text in the given variable.
  159.  
  160.         input name
  161.         input name <aux: >aux:
  162.  
  163.  interact    enter interactive mode until the command "exit" is issued.
  164.         See "Modes of Operation" below for more details.
  165.  
  166.  ls        display a short listing of files.  Sytax is the same as
  167.         "dir", but the files are listed in columns of filenames
  168.         rather than with the size, date, time, etc.
  169.  
  170.  mkdir        create a directory (folder) with the given name.
  171.  
  172.         mkdir tree
  173.         mkdir c:\blah
  174.         mkdir \test\phroo    # note: \test will not be created
  175.                     # if it doesn't already exist
  176.  
  177.  mv        identical to "cp" but, if a file is successfully copied,
  178.         the original file will be deleted.
  179.  
  180.  ren        rename a file
  181.  
  182.         ren fubar.doc foobar.doc
  183.         ren jimbob \texts\    # jimbob -> \texts\jimbob
  184.         
  185.         * Note: files can be renamed to anywhere on a logical drive
  186.         without being copied or moved (renaming is faster), but
  187.         not between drives.
  188.         * Note: under TOS 1.4 or greater, folders can also be
  189.         renamed.
  190.  
  191.  rm        delete the specified file or files.
  192.  
  193.         rm fubar.txt
  194.         rm *.*
  195.         rm *.txt
  196.  
  197.  rmdir        delete the specified directory (folder)
  198.  
  199.         rmdir test
  200.         rmdir c:\temp
  201.         
  202.         * Note: trying to delete a non-empty directory will result
  203.         in an error message.
  204.  
  205.  set        change the value of a user or system variable, or, if the
  206.         variable specified does not exist, create a new variable
  207.         with the given information.
  208.  
  209.         set name Tom
  210.         set verbosity 2
  211.         set name        # display the contents of $name
  212.         set            # list all user-defined variables
  213.         set s            # list all system variables
  214.         set f            # list function key macros
  215.         
  216.  system        exit all levels of TomShell and return to the calling
  217.         program.  Differs from "exit" in that if it is called
  218.         from a nested batch file or an "interact" system, the
  219.         system will exit completely rather than going back one
  220.         level.
  221.         
  222.         system
  223.  
  224.  unalias    remove an alias entry from the list
  225.  
  226.         unalias v
  227.  
  228.  unset        remove a variable entry from the list
  229.  
  230.         unset name
  231.  
  232.  verbatim    display a file to the console.  NOTE: This will ONLY output
  233.         to the console and cannot be redirected.  It provides the
  234.         advantage of being able to view a file containing non-ASCII
  235.         characters properly.  Any character except for <cr> and <lf>
  236.         will be output as some form of character.  Great for looking
  237.         at binary files (why?)
  238.  
  239.         verbatim tomshell.ttp
  240.  
  241.  word        truncate the given variable to only one word (everything
  242.         before the first space)
  243.         
  244.         word name    # "Tom Clegg" -> "Tom"
  245.  
  246.  
  247.  2. Batch files only
  248.  -------------------
  249.  gosub         goto          if            ifv           resume        return
  250.  :label
  251.  
  252.  gosub        branch to a given label until a "return" statement is
  253.         encountered, whereupon execution will continue from this
  254.         point
  255.         
  256.         gosub test.label
  257.  
  258.  goto        branch to a given label
  259.  
  260.         goto test.label.2
  261.         
  262.         * Note: gosub, goto, and return work just like in BASIC.
  263.  
  264.  if        conditional statement, can use "and"/"or". Just like BASIC,
  265.         but the [in]equality operators are like C (==, !=, <, >,
  266.         <=, >=)
  267.  
  268.         if <exp> and <exp> or <exp> then <cmd>
  269.         if $status >= 0 and $key == off then phroo.bat
  270.         if $status <0 or $key == on then fubar
  271.         if $status != 3 then gosub test.label.3
  272.  
  273.  i